package com.example.shop_car_2208.adapter

import android.widget.CheckBox
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shop_car_2208.R
import com.example.shop_car_2208.entity.CarEntity
import com.example.shop_car_2208.utils.GlideUtils

class CarAdapter:BaseQuickAdapter<CarEntity,BaseViewHolder>(R.layout.item_car) {
    override fun convert(holder: BaseViewHolder, item: CarEntity) {
        holder.setText(R.id.car_desc,item.goods_desc)
        holder.setText(R.id.car_pice,"${item.goods_default_price}")
        holder.setText(R.id.car_count,"${item.count}")
        GlideUtils.loafImage(context,holder.getView(R.id.car_iv),item.goods_default_icon)
        //复选框需要更新值--展示值
        holder.getView<CheckBox>(R.id.car_cb).isChecked = item.isChecked
    }
}